#pragma once

#include <gexpl_timer_event.h>
#include <gofcl_timer_dmainten.h>

typedef struct {
	timer_event_expl_s int_en;
	timer_event_expl_s dma_en;
} __attribute__((aligned(2))) timer_dmainten_expl_s;

_Static_assert(sizeof(timer_dmainten_expl_s) == 2,
	       "Struct timer_dmainten_expl_s defined error!");

static inline void timer_en_di_dma_int(timer_qe timer_q,
				       timer_dmainten_expl_s dmainten) {
	union {
		timer_dmainten_expl_s e;
		timer_dmainten_s d;
	} ed = {
		.e = dmainten,
	};
	timer_wreg_dmainten_s(timer_q, ed.d);
}
